package factorymodel2;

import factorymodel2.impl.Billows;
import factorymodel2.impl.Marco;
import factorymodel2.impl.Mirror;

public class HeroFactory {
    public final static int TYPE_BILLOWS=1;
    public final static int TYPE_MIRROR=2;
    public final static int TYPE_MARCO=3;

    public static Hero createHeroes(int type){
        switch (type){
            case TYPE_BILLOWS:
                return new Billows();
            case TYPE_MARCO:
                return new Marco();
            case TYPE_MIRROR:
                return new Mirror();
            default:
                throw new RuntimeException("没有该英雄");
        }
    }

    private HeroFactory(){}
}
